package com.demostic.demostic_test.utils;

import android.content.Context;
import android.view.View;

import androidx.appcompat.app.AlertDialog;

import com.demostic.demostic_test.R;

public class AlertDialogUtils {
    static final String TAG = AlertDialogUtils.class.getSimpleName();

    public static AlertDialog showDialog(Context context, View contentView, int width, int height) {
        AlertDialog.Builder builder = new AlertDialog.Builder(context, R.style.AlertDialog_Style);
        builder.setView(contentView);
        AlertDialog dialog = builder.create();
        dialog.show();
        dialog.getWindow().setLayout(width, height);
        return dialog;
    }

    public static void hidden(AlertDialog dialog) {
        if (dialog != null && dialog.isShowing()) {
            dialog.dismiss();
        }
    }
}
